
<?php $this->load->view('inc_head');?>
<body>
	<div id="topslide">
		<a href="javascript:" class="slidebtn slideleft" title="左"></a>
		<ul>
			<?php foreach ($toplist as $key => $value):?>
			<li>
				<img src="<?=$value['image'];?>" onload="OverImage(this,507,380)" />
				<div class="mask ani"></div>
				<div class="desc ani">
					<p><?=empty($value['mnick'])?$value['mname']:$value['mnick']?><br />
						主题：<?=$value['title']?> <br />
						故事：<?=utf8_substr($value['content'],25)?>
					</p>
					<a href="<?=site_url('/space/work/'.$value['mid'].'/'.$value['id'])?>">查看了解</a>
				</div>
			</li>
			<?php endforeach;?>
		</ul>
		<a href="javascript:" class="slidebtn slideright" title="右"></a>
	</div>
	<script type="text/javascript">
		(function($){
			if($('#topslide ul li').length<1){
				$('#topslide').animate({height:0});
				return;
			}
			var dump = $('#topslide ul').html();
			$('#topslide ul').html(dump+dump);
			var lists=$('#topslide li');
			lists.hover(function(){
				lists.not(this).addClass('mask');
				$(this).addClass('hover');
			},function(){
				lists.removeClass('mask');
				$(this).removeClass('hover');
			});
			var i=0,bwidth=939,lw=lists.eq(0).outerWidth(true);
			var l=lists.length;
			var mw=lw*l;
			$('#topslide ul').width(mw);
			$('#topslide .slideright').click(function(){
				slide();
			});
			$('#topslide .slideleft').click(function(){
				i--;
				slide(false);
			});
			var t=setTimeout(slide,5000);

			slide(false);

			function slide(isauto){
				clearTimeout(t);
				if(isauto!==false)i++;
				var sw = ($(window).width()-bwidth)*.5;
				mleft = sw - lw*i;
				while(mleft+mw<$(window).width()){
					mleft += mw*.5;
				}
				while(mleft>0){
					mleft -= mw*.5;
				}
				$('#topslide ul').stop(true,false).animate({marginLeft:mleft});
				t=setTimeout(slide,5000);
			}

		})(jQuery);

	</script>
	<?php $this->load->view('inc_header');?>
	<?php $this->load->view('inc_ad');?>
	<?php if($member->isLogin()):?>
		<div class="clearfix wrapper" id="maincontainer">
			<div class="left clearfix" id="container">
				<div class="showgroup">
				<?php $this->load->view('index_logined');?>
				</div>
				<div class="pagination">
				<a href="javascript:" onClick="loadmore(this,'.showgroup','dl')">加载更多&gt;&gt;</a>
				</div>
			</div>
			<div class="right" id="sidebar">
				<?php $this->load->view('inc_sidemember');?>
				<?php $this->load->view('inc_sidenewjoin');?>
			</div>
			<div class="clear"></div>
		</div>
	<?php else:?>
		<div class="wrapper" id="indexcontainer">
			<div class="showgroup">
			<?php $this->load->view('index_no');?>
			</div>
			<div class="pagination">
			<a href="javascript:" onClick="loadmore(this,'.showgroup','dl')">加载更多&gt;&gt;</a>
			</div>
		</div>
	<?php endif;?>

	<?php $this->load->view('inc_footer');?>
</body>
</html>